1. Coordinate Systems

b. Distance Formula - 2D, 3D and nD

1. Distance Formula in 2D

Recall the Pythagorean Theorem:

If the legs of a triangle are \(a\) and \(b\), and the hypotenuse is \(c\), then \[ c=\sqrt{a^2+b^2} \]

We can use the Pythagorean Theorem to find the distance between two points in the plane. Consider two points \(P=(p_1,p_2)\) and \(Q=(q_1,q_2)\) as shown: The difference in the \(x\)-coordinates is \(|q_1-p_1|\) and the difference in the \(y\)-coordinates is \(|q_2-p_2|\). These are the two legs of a right triangle whose hypotenuse is the distance between the points \(P\) and \(Q\). Consequently, by the Pythagorean Theorem, we conclude:

The plot shows a right triangle in the first quadrant with one leg
		parallel to the x axis at the bottom of the triangle and the 
		other leg parallel to the y axis to the right of the triangle. The top 
		right vertex of the triangle is labeled Q=(q1,q2) and the bottom left vertex 
		is labeled P=(p1,p2). The hypotenuse is labeled d(P,Q), the horizontal leg 
		is labeled absolute value of q1-p| and the vertical leg is labeled absolute
		value of q2-p2.

The distance between the points \(P=(p_1,p_2)\) and \(Q=(q_1,q_2)\) is: \[ d(P,Q)=\sqrt{(q_1-p_1)^2+(q_2-p_2)^2} \]

Find the distance between the points \(A=(5,2)\) and \(B=(-3,8)\)

\(d(A,B)=10\)

The distance between \(A=(5,2)\) and \(B=(-3,8)\) is: \[\begin{aligned} d(A,B)&=\sqrt{(b_1-a_1)^2+(b_2-a_2)^2} \\ &=\sqrt{(-3-5)^2+(8-2)^2} \\ &=\sqrt{64+36}=10 \end{aligned}\]

The plot shows a right triangle in the first and second quadrants
			with one leg parallel to the x axis on the left, labeled 6 and the other
			leg parallel to the y axis on the bottom, labeled 8. The top 
			left vertex of the triangle is labeled B=(-3,8) and the bottom right 
			vertex is labeled A=(5,2).

You can also use the two Maplets below for practice with the Pythagorean Theorem and finding the distance between two points in the plane (requires Maple on the computer where this is executed):

Pythagorean Theorem PracticeRate It

Distance Between Two PointsRate It

Equation of a Circle

By definition, the circle of radius \(r\) centered at a point \(C=(a,b)\) is the set of all points \(X=(x,y)\) whose distance from \(C\) is \(r\). Using the distance formula, this circle is the set of all points \(X=(x,y)\) satisfying the equation \[ d(C,X)=r \] or \[ \sqrt{(x-a)^2+(y-b)^2}=r \]

The circle of radius \(r\) centered at a point \(C=(a,b)\) is: \[ (x-a)^2+(y-b)^2=r^2 \]

Find the equation of the circle centered at \(P=(-3,8)\) which is tangent to the \(x\)-axis.

Draw a picture. What is the distance from \(P=(-3,8)\) to the \(x\)-axis?

\((x+3)^2+(y-8)^2=64\)

The distance from \(P=(-3,8)\) to the \(x\)-axis is \(8\), the \(y\) coordinate of \(P\). This is the radius. So the circle is \((x+3)^2+(y-8)^2=64\).

The plot shows a circle with center labeled (-3,8) which touches the 
			x axis only at the circle's bottommost point. The line segment from the 
			center to this point is labeled r=8.

Some exercises on circles use the fact that the center of a circle is at the midpoint of a diameter.

Midpoint of a Line Segment

The midpoint of a line segment is the point halfway between the endpoints. So its coordinates are found by averaging the coordinates of its endpoints. Specifically,

If the endpoints of a line segment are \(P=(a,b)\) and \(Q=(c,d)\), then the midpoint is: \[ M=\left(\dfrac{a+c}{2}, \dfrac{b+d}{2} \right). \]

Find the equation of the circle which has a diameter with endpoints \(P=(-2,3)\) and \(Q=(4,7)\).

The center is at the midpoint of the line segment between \(P=(-2,3)\) and \(Q=(4,7)\). The radius is half of the diameter.

\((x-1)^2+(y-5)^2=13\)

The center of the circle is at the midpoint of the line segment between \(P=(-2,3)\) and \(Q=(4,7)\) which is found by averaging their coordinates: \[ C=\left(\dfrac{-2+4}{2}, \dfrac{3+7}{2} \right)=(1,5) \] The radius of the circle is half of the distance between \(P\) and \(Q\). This distance is \[ d(P,Q)=\sqrt{(4--2)^2+(7-3)^2}=2\sqrt{13} \]

The plot shows a circle with center labeled (1,5) in the first
			quadrant with two points on opposite ends of a diameter, one on the
			bottom left labeled (-2,3) and the other on the top right labeled (4,7). 
			The radius line from the center to the top right point is labeled 
			r = square root of 13.

and so, the radius is \(r=\sqrt{13}\). So the equation of the circle is: \[ (x-1)^2+(y-5)^2=13 \]

You can also practice computing the midpoint of a line segment using the following Maplet (requires Maple on the computer where this is executed):

Midpoint of the Line Segment Between Two Points in 2DRate It

© MY Math Apps

Supported in part by NSF Grant #1123255

NSF logo